

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>开启头部工具栏 - 数据表格</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/layadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/layadmin/style/admin.css" media="all">
</head>
<body>

  <div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb">
      <a lay-href="">主页</a>
      <a><cite>组件</cite></a>
      <a><cite>数据表格</cite></a>
      <a><cite>开启头部工具栏</cite></a>
    </div>
  </div>
  
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">{$fname}</div>
          <div class="layui-card-body">
            <table id="list-table" lay-filter="test-table-toolbar">
              <thead>
                <tr>
                  <th lay-data="{type:'checkbox',fixed: 'left', }"></th>
                  <th lay-data="{field:'id', width:80,fixed: 'left', unresize: true, sort: true}">ID</th>
                  <th lay-data="{field:'name'}">模型名称</th>
                  <th lay-data="{field:'summary'}">使用说明</th>
                  <th lay-data="{field:'type', width:120, sort:true}">类型</th>
                  <th lay-data="{field:'mark', width:120, sort:true}">模型标识</th>
                  <th lay-data="{field:'level', width:120, sort:true}">栏目层级</th>
                  <th lay-data="{field:'url', width:120, sort:true}">是否外链</th>
                  
                </tr> 
              </thead>
              <tbody>
                {volist name="mess" id="v"}
                <tr level="{$v.id}">
                  <td><input type="checkbox" name=""></td>
                  <td>{$v.id}</td>
                  <td><a style="color: green;font-weight: bold;">{$v.name}</a></td>
                  <td>{$v.summary}</td>
                  <td>{if condition="$v.type eq 1"}列表{elseif condition="$v.type eq 2"/}单页{else/}外链{/if}</td>
                  <td>{$v.mark}</td>
                  <td>{$v.level}级</td>
                  <td> {if condition="$v.url eq 1"}是{else/}否{/if}</td>
                  
                </tr>                    
                {/volist}                
              </tbody>
            </table>
            
    
             

          </div>
        </div>
      </div>
    </div>
  </div>
  
  <script src="/static/layadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/static/layadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'table','form','laypage'], function(){
    var admin = layui.admin
    ,table = layui.table
    ,laypage  = layui.laypage 
    ,$ = layui.$
    ,form = layui.form;
    
    table.init('test-table-toolbar', {
      // height: 315 //设置高度
      // ,limit: 10 //注意：请务必确保 limit 参数（默认：10）是与你服务端限定的数据条数一致
      //支持所有基础参数
      // toolbar: '#test-table-toolbar-toolbarDemo',
      page: true //开启分页
      ,limit: 100
    }); 

  });
  </script>
</body>
</html>